/*
 * @lc app=leetcode.cn id=275 lang=cpp
 *
 * [275] H 指数 II
 */

// @lc code=start
class Solution {
public:
    int hIndex(vector<int>& citations) {
        int ans = 0;
        for(int i = 0; i < citations.size(); i++)
        {
            if(citations[citations.size() - i - 1] >= i+1)
            {
                ans = i + 1;
            }
        }
        return ans;
    }
};
// @lc code=end

